package com.demo.exception;


import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@ResponseBody
public class DemoAdvice {


    @ExceptionHandler(Exception.class)
    public String handler(Exception e){
        System.out.println(e);
        return e.getMessage();
    }
}
